﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using PPIProxy.PPIWebservice;


namespace PPIProxy
{
    public class WUtility_Asset_XMissionStructure_Pole
    {
        /// <summary>
        /// Insert a new Pole
        /// </summary>
        /// <param name="utilityID"></param>
        /// <param name="XMissionStructures_PoleTopTypeID"></param>
        /// <param name="XMissionStructures_PoleSpeciesID"></param>
        /// <param name="XMissionStructures_PoleTreatmentID"></param>
        /// <param name="Year"></param>
        /// <param name="XMissionStructures_PoleClassID"></param>
        /// <param name="Latitude"></param>
        /// <param name="Longitude"></param>
        /// <param name="Altitude"></param>
        /// <param name="SatelliteCount"></param>
        /// <param name="SatelliteTime"></param>
        /// <param name="AID"></param>
        /// <param name="LVisit"></param>
        /// <param name="Number"></param>
        /// <param name="Length"></param>
        /// <param name="LVisitor"></param>
        /// <param name="SolutionAvaible"></param>
        /// <returns></returns>
        public static Int32 Insert(Int32 utilityID, Int32 XMissionStructures_PoleTopTypeID, Int32 XMissionStructures_PoleSpeciesID, Int32 XMissionStructures_PoleTreatmentID, Int32 Year, Int32 XMissionStructures_PoleClassID, double Latitude, double Longitude, double Altitude, Int32 SatelliteCount, DateTime SatelliteTime, string AID, Int32 LVisit, string Number, double Length, string LVisitor, bool SolutionAvaible, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return
                serv.Utility_Asset_XMisssionStructure_Pole_Insert(utilityID, XMissionStructures_PoleTopTypeID,
                                                                  XMissionStructures_PoleSpeciesID,
                                                                  XMissionStructures_PoleTreatmentID, Year,
                                                                  XMissionStructures_PoleClassID, Latitude, Latitude,
                                                                  Altitude, SatelliteCount, SatelliteTime, AID, LVisit,
                                                                  Number, Length, LVisitor, SolutionAvaible,
                                                                  connectionKey);
            

        }

        /// <summary>
        /// Update a pole by poleId
        /// </summary>
        /// <param name="poleID"></param>
        /// <param name="utilityID"></param>
        /// <param name="XMissionStructures_PoleTopTypeID"></param>
        /// <param name="XMissionStructures_PoleSpeciesID"></param>
        /// <param name="XMissionStructures_PoleTreatmentID"></param>
        /// <param name="Year"></param>
        /// <param name="XMissionStructures_PoleClassID"></param>
        /// <param name="Latitude"></param>
        /// <param name="Longitude"></param>
        /// <param name="Altitude"></param>
        /// <param name="SatelliteCount"></param>
        /// <param name="SatelliteTime"></param>
        /// <param name="AID"></param>
        /// <param name="LVisit"></param>
        /// <param name="Number"></param>
        /// <param name="Length"></param>
        /// <param name="LVisitor"></param>
        /// <param name="SolutionAvaible"></param>
        public static void Update(Int32 poleID, Int32 utilityID, Int32 XMissionStructures_PoleTopTypeID, Int32 XMissionStructures_PoleSpeciesID, Int32 XMissionStructures_PoleTreatmentID, Int32 Year, Int32 XMissionStructures_PoleClassID, double Latitude, double Longitude, double Altitude, Int32 SatelliteCount, DateTime SatelliteTime, string AID, Int32 LVisit, string Number, double Length, string LVisitor, bool SolutionAvaible, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Utility_Asset_XMisssionStructure_Pole_Update(poleID, utilityID, XMissionStructures_PoleTopTypeID,
                                                              XMissionStructures_PoleSpeciesID,
                                                              XMissionStructures_PoleTreatmentID, Year,
                                                              XMissionStructures_PoleClassID, Latitude, Longitude,
                                                              Altitude, SatelliteCount, SatelliteTime, AID, LVisit,
                                                              Number, Length, LVisitor, SolutionAvaible, connectionKey);

        }

        /// <summary>
        /// Delete a pole
        /// </summary>
        /// <param name="poleID"></param>
        public static void Delete(Int32 poleID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Utility_Asset_XMisssionStructure_Pole_Delete(poleID, connectionKey);
        }
    }
}
